﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Communication;

namespace Clipper.EngineerWindow
{
    /// <summary>
    /// UserArmCmd.xaml 的交互逻辑
    /// </summary>
    public partial class UserArmCmd : UserControl
    {
        public UserArmCmd()
        {
            InitializeComponent();
        }
        ArmControl mArm=null;
        public void Init(string ArmName,ArmControl armControl)
        {
            txtArmName.Text = ArmName;
            mArm=armControl;
        }
        private void btnArmCmd_Click(object sender, RoutedEventArgs e)
        {

                string btnName = ((Button)sender).Name;
                switch (btnName)
                {
                    case "btnArmReset":
                        mArm.Reset();
                        break;
                    case "btnImbibe":
                        if (txtImbibe.Text == "")
                            mArm.Imbibe();
                        else
                            mArm.Imbibe(txtImbibe.Number);
                        break;
                    case "btnInject":
                        mArm.Inject();
                        break;
                    case "btnRinse":
                        mArm.Rinse();
                        mArm.WaitRinseTime();
                        break;
                }
            
        }

    }
}
